package awk.etl.function;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 用户自定义数据集函数
 */
public class EkkoFunction implements EtlFunction {

    @Override
    public String nameSpace() {
        return "ekko";
    }

    @EtlFunctionAnnotation
    public static Object converge(List<Map<String,Object>> ... datasets){
        List<Map<String,Object>> result = new ArrayList<>();
        for (List<Map<String, Object>> dataset : datasets) {
            result.addAll(dataset);
        }
        return result;
    }

    @EtlFunctionAnnotation
    public static Object converge_join(List<Map<String,Object>> dataset1,List<Map<String,Object>> dataset2){
        List<Map<String,Object>> result = new ArrayList<>();
        result.addAll(dataset1);
        result.addAll(dataset2);
        return result;
    }
}
